<?xml version="1.0" encoding="UTF-8" ?>
<!--
  ~ MikoPBX - free phone system for small business
  ~ Copyright © 2017-2021 Alexey Portnov and Nikolay Beketov
  ~
  ~ This program is free software: you can redistribute it and/or modify
  ~ it under the terms of the GNU General Public License as published by
  ~ the Free Software Foundation; either version 3 of the License, or
  ~ (at your option) any later version.
  ~
  ~ This program is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ~ GNU General Public License for more details.
  ~
  ~ You should have received a copy of the GNU General Public License along with this program.
  ~ If not, see <https://www.gnu.org/licenses/>.
  -->

<!--
sipp 172.16.156.223 -s 74992293344 -sf scenario.xml -set m_user 'SIP-1611151795' -rtp_echo -l 10 -trace_err
  - 172.16.156.223 - адрес атс, куда звонить
  - 74992293344 - DID
  - scenario.xml - имя файла сценария
  - SIP-1611151795 - ID учетки провайдера, через готорого поступит вызов на АТС
  - 10 - количество одновременных вызовов

sh /usr/www/tests/Calls/start.sh 00 600

-->

<scenario name="Basic UAC scenario">
    <Global variables="m_user" />
    <send>
        <![CDATA[
  INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
  Via: SIP/2.0/[transport] [local_ip]:[local_port]
  From: [$m_user] <sip:[$m_user]@[local_ip]:[local_port]>;tag=[call_number]
  To: [service] <sip:[service]@[remote_ip]:[remote_port]>
  Call-ID: [call_id]
  Cseq: 1 INVITE
  Contact: sip:[$m_user]@[local_ip]:[local_port]
  Content-Type: application/sdp
  Content-Length: [len]

  v=0
  o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
  s=-
  t=0 0
  c=IN IP[media_ip_type] [media_ip]
  m=audio [media_port] RTP/AVP 0
  a=rtpmap:0 PCMU/8000
  ]]>
    </send>

    <recv response="100" optional="true">
    </recv>

    <recv response="183" optional="true">
    </recv>

    <recv response="200">
    </recv>

    <send>
        <![CDATA[
  ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
  Via: SIP/2.0/[transport] [local_ip]:[local_port]
  From: [$m_user] <sip:[$m_user]@[local_ip]:[local_port]>;tag=[call_number]
  To: [service] <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
  Call-ID: [call_id]
  Cseq: 1 ACK
  Contact: sip:[$m_user]@[local_ip]:[local_port]
  Content-Length: 0
  ]]>
    </send>

    <pause milliseconds="5000"/>

    <send retrans="500">
        <![CDATA[
  BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
  Via: SIP/2.0/[transport] [local_ip]:[local_port]
  From: [$m_user]  <sip:[$m_user]@[local_ip]:[local_port]>;tag=[call_number]
  To: [service]  <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
  Call-ID: [call_id]
  Cseq: 2 BYE
  Contact: sip:[$m_user]@[local_ip]:[local_port]
  Content-Length: 0
  ]]>
    </send>

    <recv response="200">
    </recv>

</scenario>